package com.sky.demo.proxy.dynamicproxy;

import com.sky.demo.proxy.staticproxy.IRentingHouse;
import com.sky.demo.proxy.staticproxy.IRentingHouseImp;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * Description:
 *
 * @author Sky
 * @Date 2021/7/31 14:26
 */
public class JdkProxy {
    public static void main(String[] args) {
        // 租房委托方
        IRentingHouse rentingHouse = new IRentingHouseImp();

        IRentingHouse proxy = (IRentingHouse) ProxyFactory.INSTANCE.getJdkProxy(rentingHouse);

        proxy.rentHouse();
    }
}
